import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/order',
    name: 'Order',
    component: () => import('../views/Order.vue'),
  },
  {
    path: '/order_details',
    name: 'OrderDetails',
    component: () => import('../views/OrderDetails.vue'),
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index.vue'),
  },
  {
    path: '/searchresult/:lid',
    name: 'SearchResult',
    props:true,
    component: () => import('../views/SearchResult.vue'),
  },
  {
    path: '/classify',
    name: 'Classify',
    component: () => import('../views/Classify.vue'),
  },
  {
    path: '/shoppingCart',
    name: 'ShoppingCart',
    component: () => import('../views/ShoppingCart.vue'),
  },
  {
    path: '/shoppingDetails',
    name: 'ShoppingDetails',
    component: () => import('../views/ShoppingDetails.vue'),
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('../views/Search.vue'),
  },
  {
    path: '/user',
    name: 'User',
    component: () => import('../views/User.vue'),
  },
  {
    path: '/address',
    name: 'Address',
    component: () => import('../views/Address.vue'),
  }, 
  {
    path: '/add_address',
    name: 'AddAddress',
    component: () => import('../views/AddAddress.vue'),
  },   
  {
    path: '/',
    name: 'HHHem',
    component: () => import('../views/HHHem.vue'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
